﻿namespace VisualWip.Core.Columns
{
    public class RichTextColumn : Column
    {
        private string _document;

        public RichTextColumn()
        {
            Height = 300;
            Width = 300;
            PositionY = 0;
        }

        public string Document
        {
            get { return _document; }
            set
            {
                if (value != _document)
                {
                    _document = value;
                    OnPropertyChanged(this, () => Document);
                }
            }
        }

        public override PersistenceTree Persist(string name)
        {
            PersistenceTree settings = base.Persist(name);
            settings.Add(() => Document);
            return settings;
        }

        public override void Load(PersistenceTree settings)
        {
            base.Load(settings);
            Document = settings.Get(() => Document,string.Empty);
        }

        public override void DoRefresh()
        {
        }
    }
}